Skip to content

Fix wildcard protos #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 19, 2016
Merged

Fix wildcard protos #1402

merged 3 commits into from
Jul 19, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 19, 2016

Fixes issue discovered by @cswinter on #1396. Also fixes printing of tuple and function types with wildcards. Review by @smarter.

@smarter
Copy link
Member

smarter commented Jul 19, 2016

If I write:

  val foo = (x: (_ <: String)) => 1

Then I get after frontend:

    val foo: _ <: String => Int = {
      def $anonfun(x:  >: Nothing <: String): Int = 1
      closure($anonfun)
    }

Which compiles, but the type of the parameter of the def shouldn't be a wildcard, right?.

@smarter
Copy link
Member

smarter commented Jul 19, 2016

I guess my example shouldn't even compile, in scalac we get error: unbound wildcard type

@smarter
Copy link
Member

smarter commented Jul 19, 2016

LGTM, opened #1403 to keep track of the issue I noted above

@smarter smarter merged commit 0536d1f into scala:master Jul 19, 2016
@smarter smarter removed the reviewed label Jul 19, 2016
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this pull request Dec 8, 2016
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this pull request Dec 12, 2016
@allanrenucci allanrenucci deleted the fix-wildcard-protos branch December 14, 2017 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants